home *** CD-ROM | disk | FTP | other *** search
/ Treccani Italiana Di Scienze Lettere Ed Arti / [Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso / pc / data / xxi_appendice_dvd.swf / scripts / __Packages / CAppendiceLemmaViewer.as < prev    next >
Text File  |  2007-11-08  |  24KB  |  667 lines

  1. class CAppendiceLemmaViewer extends mx.core.UIObject
  2. {
  3.    function CAppendiceLemmaViewer()
  4.    {
  5.       super();
  6.       this.mInitialized = false;
  7.       this.mClassName = "CAppendiceLemmaViewer";
  8.       this.mc_TreeIndiceLemma._visible = false;
  9.       this.Hide();
  10.       this.doLater(this,"init");
  11.    }
  12.    function GetStatus()
  13.    {
  14.       var _loc2_ = new Object();
  15.       _loc2_.currentTab = this.ActiveTab();
  16.       _loc2_.from = this.mFrom;
  17.       _loc2_.searchActive = this.rb_LwRisultatoRicerca.enabled;
  18.       _loc2_.searchData = this.mSearchData;
  19.       _loc2_.searchOrMediaActiveTab = this.mRadioContribOrResultGroup.selection.data;
  20.       _loc2_.currentChapter = this.mCurrentChapter;
  21.       _loc2_.mediaScrollPos = this.mc_MediaLemma.GetScrollPos();
  22.       return _loc2_;
  23.    }
  24.    function SetStatus(statusObj)
  25.    {
  26.       this.mCurrentChapter = statusObj.currentChapter;
  27.       this.rb_TestoVoce.selected = statusObj.currentTab == this.rb_TestoVoce.__get__data();
  28.       this.rb_Abstract.selected = statusObj.currentTab == this.rb_Abstract.__get__data();
  29.       this.rb_IndiceVoce.selected = statusObj.currentTab == this.rb_IndiceVoce.__get__data();
  30.       this.SetActiveTab(statusObj.currentTab);
  31.       this.SetupSearchResultTab(statusObj.from,statusObj.searchData);
  32.       this.rb_LwRisultatoRicerca.selected = statusObj.searchOrMediaActiveTab == this.rb_LwRisultatoRicerca.__get__data();
  33.       this.rb_LwContributiMediali.selected = statusObj.searchOrMediaActiveTab == this.rb_LwContributiMediali.__get__data();
  34.       this.SetContribResultTab(statusObj.searchOrMediaActiveTab);
  35.       if(statusObj.mediaScrollPos != 0)
  36.       {
  37.          this.mc_MediaLemma.SetScrollPos(statusObj.mediaScrollPos);
  38.       }
  39.    }
  40.    function init()
  41.    {
  42.       this.mInitialized = true;
  43.       this.mSearchData = null;
  44.       this.mFrom = "";
  45.       this.mCurrentTab = "testoVoce";
  46.       this.mc_TreeIndiceLemma._visible = false;
  47.       this.mc_TreeIndiceLemma.embedFonts = _global.gUseEmbeddedFont;
  48.       this.mc_TreeIndiceLemma.__set__rowHeight(22);
  49.       this.mc_HtmlRenderer.html = true;
  50.       this.mc_HtmlRenderer._visible = false;
  51.       this.mc_NSChapterSwitcher.__set__minimum(1);
  52.       this.mc_NSChapterSwitcher.__set__maximum(1);
  53.       this.mc_NSChapterSwitcher.prevButton_mc._x = - this.mc_NSChapterSwitcher.prevButton_mc.__width - 5;
  54.       this.mc_NSChapterSwitcher.prevButton_mc._y = this.mc_NSChapterSwitcher.nextButton_mc._y = Math.round((this.mc_NSChapterSwitcher.__get__height() - this.mc_NSChapterSwitcher.nextButton_mc.__get__height()) / 2);
  55.       this.mc_NSChapterSwitcher.nextButton_mc._x = this.mc_NSChapterSwitcher.__width - this.mc_NSChapterSwitcher.prevButton_mc.__width + 5;
  56.       this.mc_NSChapterSwitcher.StepTrack_mc._visible = false;
  57.       this.mc_NSChapterSwitcher._visible = false;
  58.       this.mc_TxtTestoLemma.setVScrollPolicy("on");
  59.       this.mc_LblTitolo.html = true;
  60.       this.mc_LblTitolo.embedFonts = _global.gUseEmbeddedFont;
  61.       this.mc_LblTitolo.styleSheet = _global.gStyleManager.GetCSS();
  62.       this.mc_LblSottoTitolo.html = true;
  63.       this.mc_LblSottoTitolo.embedFonts = _global.gUseEmbeddedFont;
  64.       this.mc_LblSottoTitolo.styleSheet = _global.gStyleManager.GetCSS();
  65.       this.mc_TxtTestoLemma.setStyle("borderStyle","solid");
  66.       this.mc_TxtTestoLemma.setStyle("borderColor",12566711);
  67.       this.mc_TxtTestoLemma.embedFonts = _global.gUseEmbeddedFont;
  68.       this.mc_TxtTestoLemma.__set__styleSheet(_global.gStyleManager.GetCSS());
  69.       _global.gStyleManager.addListener(this);
  70.       this.mRadiolemmaGroup.addEventListener("click",mx.utils.Delegate.create(this,this.onLemmaViewChange));
  71.       this.mRadioContribOrResultGroup.addEventListener("click",mx.utils.Delegate.create(this,this.onContribResultViewChange));
  72.       this.mc_NSChapterSwitcher.addEventListener("change",mx.utils.Delegate.create(this,this.onChapterChange));
  73.       this.mc_BtnTornaARicerca.addEventListener("click",mx.utils.Delegate.create(this,this.Back));
  74.       this.mc_TreeIndiceLemma.addEventListener("change",mx.utils.Delegate.create(this,this.onNodeSelected));
  75.       this.mc_TreeIndiceLemma.setStyle("borderStyle","solid");
  76.       this.mc_TreeIndiceLemma.setStyle("borderColor",12566711);
  77.       this.mc_TreeIndiceLemma.setStyle("defaultLeafIcon","icona_posizioni_pagina");
  78.       this.mc_TreeIndiceLemma.setStyle("indentation",8);
  79.       this.mc_TreeIndiceLemma.setStyle("folderClosedIcon","empty_tree_folder_Icon");
  80.       this.mc_TreeIndiceLemma.setStyle("folderOpenIcon","empty_tree_folder_Icon");
  81.       this.mc_TreeIndiceLemma.setStyle("selectionColor",16099163);
  82.       this.mc_TreeIndiceLemma.setStyle("rollOverColor",16703406);
  83.       this.mc_TreeIndiceLemma.setStyle("textRollOverColor",16777215);
  84.       this.mc_TreeIndiceLemma.setStyle("textSelectedColor",16777215);
  85.       this.mc_TreeIndiceLemma.__set__cellRenderer("HtmlTreeCellRenderer");
  86.       this.mc_Sfondo.onPress = this.ClickGrab;
  87.       this.mc_Sfondo.useHandCursor = false;
  88.    }
  89.    function ShowNumericStepper(inTrueFalse, inV)
  90.    {
  91.       this.mc_NSChapterSwitcher._visible = inTrueFalse;
  92.       this.mc_LblChapterNumber._visible = inTrueFalse;
  93.       this.mc_LblPagina._visible = inTrueFalse;
  94.       if(inTrueFalse)
  95.       {
  96.          this.mc_NSChapterSwitcher.__set__value(inV);
  97.       }
  98.    }
  99.    function ClickGrab()
  100.    {
  101.    }
  102.    function ExpandAll()
  103.    {
  104.       var _loc3_ = undefined;
  105.       var _loc2_ = undefined;
  106.       var _loc4_ = this.mc_TreeIndiceLemma.length;
  107.       _loc2_ = 0;
  108.       while(_loc2_ < _loc4_)
  109.       {
  110.          _loc3_ = this.mc_TreeIndiceLemma.getTreeNodeAt(_loc2_);
  111.          if(_loc3_ != undefined)
  112.          {
  113.             if(this.mc_TreeIndiceLemma.getIsBranch(_loc3_))
  114.             {
  115.                this.ExpandNode(_loc3_);
  116.                _loc2_ = 0;
  117.                _loc4_ = this.mc_TreeIndiceLemma.length;
  118.             }
  119.          }
  120.          _loc2_ = _loc2_ + 1;
  121.       }
  122.    }
  123.    function ExpandNode(oNode)
  124.    {
  125.       if(this.mc_TreeIndiceLemma.getIsBranch(oNode))
  126.       {
  127.          this.mc_TreeIndiceLemma.setIsOpen(oNode,true);
  128.          if(oNode.childNodes.length > 0)
  129.          {
  130.             var _loc2_ = undefined;
  131.             _loc2_ = 0;
  132.             while(_loc2_ < oNode.childNodes.length)
  133.             {
  134.                var _loc3_ = oNode.childNodes[_loc2_];
  135.                this.ExpandNode(_loc3_);
  136.                _loc2_ = _loc2_ + 1;
  137.             }
  138.          }
  139.       }
  140.    }
  141.    function CloseAll(inOpenRoot)
  142.    {
  143.       var _loc2_ = undefined;
  144.       var _loc4_ = undefined;
  145.       _loc4_ = this.mc_TreeIndiceLemma.length;
  146.       _loc2_ = 0;
  147.       while(_loc2_ < _loc4_)
  148.       {
  149.          var _loc3_ = this.mc_TreeIndiceLemma.getTreeNodeAt(_loc2_);
  150.          if(_loc3_ != undefined && this.mc_TreeIndiceLemma.getIsBranch(_loc3_))
  151.          {
  152.             this.CloseNode(_loc3_);
  153.             _loc2_ = 0;
  154.             _loc4_ = this.mc_TreeIndiceLemma.length;
  155.          }
  156.          _loc2_ = _loc2_ + 1;
  157.       }
  158.       if(inOpenRoot == true)
  159.       {
  160.          this.mc_TreeIndiceLemma.setIsOpen(this.mc_TreeIndiceLemma.getTreeNodeAt(0),true);
  161.       }
  162.    }
  163.    function CloseNode(oNode, Mode, Racine)
  164.    {
  165.       if(this.mc_TreeIndiceLemma.getIsBranch(oNode) and this.mc_TreeIndiceLemma.getIsOpen(oNode))
  166.       {
  167.          if(oNode != this.mc_TreeIndiceLemma.getTreeNodeAt(0))
  168.          {
  169.             this.mc_TreeIndiceLemma.setIsOpen(oNode,false);
  170.          }
  171.          if(oNode.childNodes.length > 0)
  172.          {
  173.             var _loc2_ = undefined;
  174.             _loc2_ = 0;
  175.             while(_loc2_ < oNode.childNodes.length)
  176.             {
  177.                var _loc3_ = oNode.childNodes[_loc2_];
  178.                this.CloseNode(_loc3_,0,false);
  179.                _loc2_ = _loc2_ + 1;
  180.             }
  181.          }
  182.       }
  183.    }
  184.    function LayoutWindow()
  185.    {
  186.    }
  187.    function ActiveTab()
  188.    {
  189.       return this.mRadiolemmaGroup.selection.data;
  190.    }
  191.    function SetState(inState)
  192.    {
  193.    }
  194.    function IconManager(itemObj)
  195.    {
  196.       if(itemObj == undefined)
  197.       {
  198.          return undefined;
  199.       }
  200.       switch(itemObj.tipo)
  201.       {
  202.          case "L":
  203.             return "lemmaIcon";
  204.          case "R":
  205.             return "rinvioIcon";
  206.          case "T":
  207.             return "tabIcon";
  208.          case "I":
  209.             return "imageIcon";
  210.          case "F":
  211.             return "imageIcon";
  212.          default:
  213.             return "emptyIcon";
  214.       }
  215.    }
  216.    function onChapterChange(evtObj)
  217.    {
  218.       this.ShowChapter(evtObj.target.value - 1,-1);
  219.    }
  220.    function onNodeSelected(evtObj)
  221.    {
  222.       var _loc3_ = evtObj.target;
  223.       var _loc2_ = this.mc_TreeIndiceLemma.__get__selectedNode();
  224.       this.ShowParagraph(_loc2_.attributes.data,_loc2_.attributes.level);
  225.    }
  226.    function onContribResultViewChange(evtObj)
  227.    {
  228.       this.SetContribResultTab(evtObj.target.selection.data);
  229.    }
  230.    function SetContribResultTab(currentTab)
  231.    {
  232.       if(currentTab == "risultatoRicerca")
  233.       {
  234.          this.mc_LwSearchResult._visible = true;
  235.       }
  236.       else if(currentTab == "contributiMediali")
  237.       {
  238.          this.mc_LwSearchResult._visible = false;
  239.       }
  240.    }
  241.    function onLemmaViewChange(evtObj)
  242.    {
  243.       this.SetActiveTab(evtObj.target.selection.data);
  244.    }
  245.    function SetActiveTab(inTab)
  246.    {
  247.       this.mCurrentTab = inTab;
  248.       if(this.mCurrentTab == "testoVoce")
  249.       {
  250.          this.ShowChapter(this.mCurrentChapter,-1);
  251.       }
  252.       if(this.mCurrentTab == "abstract")
  253.       {
  254.          this.ShowAbstract();
  255.       }
  256.       else if(this.mCurrentTab == "indice")
  257.       {
  258.          this.ShowIndex(this.mCurrentChapter);
  259.       }
  260.       this.dispatchEvent({type:"lemmaTabChange",target:this,tab:this.mCurrentTab});
  261.    }
  262.    function MostraLemma(inLemma, inFrom)
  263.    {
  264.       this.LayoutWindow();
  265.       this.mLemma = inLemma;
  266.       this.mFrom = inFrom;
  267.       this.mSearchData = _root.gAppendiceSearch.GetSearchData();
  268.       this.mc_BtnTornaARicerca.SetState(inFrom);
  269.       this.mc_LblTitolo.htmlText = inLemma.GetTitolo();
  270.       this.mc_LblTitolo.hscroll = 0;
  271.       this.mChapterCount = inLemma.GetChapterLenght();
  272.       this.mCurrentChapter = 0;
  273.       this.mc_NSChapterSwitcher.__set__maximum(this.mChapterCount);
  274.       if(this.mChapterCount <= 1)
  275.       {
  276.          this.mc_LblChapterNumber.__set__text("");
  277.          this.rb_IndiceVoce.enabled = false;
  278.       }
  279.       else
  280.       {
  281.          this.rb_IndiceVoce.enabled = true;
  282.          this.mc_NSChapterSwitcher.__set__value(1);
  283.          this.mc_LblChapterNumber.__set__text("<b> di " + String(this.mChapterCount) + "</b>");
  284.          this.InitTree(inLemma);
  285.       }
  286.       if(inLemma.HaveAbstract())
  287.       {
  288.          this.rb_Abstract.enabled = true;
  289.          this.rb_Abstract.selected = true;
  290.          this.mCurrentTab = "abstract";
  291.          this.ShowAbstract();
  292.       }
  293.       else
  294.       {
  295.          this.rb_Abstract.enabled = false;
  296.          this.rb_TestoVoce.selected = true;
  297.          this.mCurrentTab = "testoVoce";
  298.          this.ShowChapter(0,-1);
  299.       }
  300.       this.mc_MediaLemma.InitMediaPreview(inLemma.mMediaList);
  301.       this.SetupSearchResultTab(inFrom,this.mSearchData);
  302.       if(inLemma.mStatus != undefined && inLemma.mStatus != null)
  303.       {
  304.          this.SetStatus(inLemma.mStatus);
  305.       }
  306.       this.Show();
  307.    }
  308.    function SetupSearchResultTab(inFrom, searchData)
  309.    {
  310.       if(searchData.searchType == "mostra" || inFrom != "ricerca" || searchData.searchedText == "")
  311.       {
  312.          this.rb_LwRisultatoRicerca.enabled = false;
  313.          this.rb_LwContributiMediali.selected = true;
  314.          this.mc_LwSearchResult._visible = false;
  315.       }
  316.       else
  317.       {
  318.          this.rb_LwRisultatoRicerca.enabled = true;
  319.          this.rb_LwRisultatoRicerca.selected = true;
  320.          this.mc_LwSearchResult.SetSearchResults(this,searchData);
  321.          this.mc_LwSearchResult._visible = true;
  322.       }
  323.    }
  324.    function InitTree(inLemma)
  325.    {
  326.       this.mc_TreeIndiceLemma.removeAll();
  327.       var _loc10_ = 0;
  328.       var _loc8_ = undefined;
  329.       var _loc4_ = undefined;
  330.       var _loc3_ = undefined;
  331.       var _loc11_ = undefined;
  332.       var _loc6_ = 0;
  333.       while(_loc6_ < inLemma.mParagraphList.length)
  334.       {
  335.          var _loc2_ = inLemma.mParagraphList[_loc6_];
  336.          var _loc7_ = _loc2_.mTitoloSommario.length <= 0 ? _loc2_.mTitolo : _loc2_.mTitoloSommario;
  337.          var _loc5_ = _loc7_;
  338.          if(_loc6_ == 0)
  339.          {
  340.             _loc8_ = this.mc_TreeIndiceLemma.addTreeNode(_loc5_,_loc2_.mId);
  341.             _loc4_ = _loc8_;
  342.          }
  343.          else if(_loc2_.mLevel > _loc4_.attributes.level)
  344.          {
  345.             _loc4_ = _loc4_.addTreeNode(_loc5_,_loc2_.mId);
  346.          }
  347.          else if(_loc2_.mLevel == _loc4_.attributes.level)
  348.          {
  349.             _loc4_ = _loc4_.parentNode.addTreeNode(_loc5_,_loc2_.mId);
  350.          }
  351.          else
  352.          {
  353.             _loc3_ = _loc4_;
  354.             do
  355.             {
  356.                _loc3_ = _loc3_.parentNode;
  357.             }
  358.             while(_loc3_ && _loc3_.attributes.level >= _loc2_.mLevel);
  359.             
  360.             if(_loc3_)
  361.             {
  362.                _loc4_ = _loc3_.addTreeNode(_loc5_,_loc2_.mId);
  363.             }
  364.          }
  365.          _loc4_.attributes.level = _loc2_.mLevel;
  366.          _loc6_ = _loc6_ + 1;
  367.       }
  368.       this.ExpandAll();
  369.    }
  370.    function ShowAbstract(Void)
  371.    {
  372.       if(!this.rb_Abstract.selected)
  373.       {
  374.          this.rb_Abstract.selected = true;
  375.          this.mCurrentTab = "abstract";
  376.       }
  377.       this.mc_LblSottoTitolo.htmlText = this.mLemma.GetAbstractTitle();
  378.       this.mc_LblSottoTitolo.hscroll = 0;
  379.       this.mc_TxtTestoLemma.__set__text(this.mLemma.GetAbstractText());
  380.       this.mc_TxtTestoLemma.__set__vPosition(0);
  381.       this.mc_TxtTestoLemma._visible = true;
  382.       this.mc_TreeIndiceLemma._visible = false;
  383.       this.ShowNumericStepper(false,0);
  384.    }
  385.    function ShowParagraph(inParId, inLevel)
  386.    {
  387.       var _loc2_ = this.mLemma.GetParagraphChapterNumber(inParId);
  388.       this.ShowChapter(_loc2_,inParId);
  389.    }
  390.    function ShowChapter(inChapterNum, inSelParId)
  391.    {
  392.       if(!this.rb_TestoVoce.selected)
  393.       {
  394.          this.rb_TestoVoce.selected = true;
  395.          this.mCurrentTab = "testoVoce";
  396.       }
  397.       if(this.mChapterCount > 1)
  398.       {
  399.          this.ShowNumericStepper(true,inChapterNum + 1);
  400.       }
  401.       else
  402.       {
  403.          this.ShowNumericStepper(false,0);
  404.       }
  405.       this.mc_LblSottoTitolo.htmlText = this.mLemma.GetChapterTitle(inChapterNum);
  406.       this.mc_LblSottoTitolo.hscroll = 0;
  407.       this.mc_TxtTestoLemma.__set__text(this.mLemma.GetChapterText(inChapterNum));
  408.       this.mc_TxtTestoLemma.__set__vPosition(0);
  409.       this.mCurrentChapter = inChapterNum;
  410.       this.mc_TxtTestoLemma._visible = true;
  411.       this.mc_TreeIndiceLemma._visible = false;
  412.       if(inSelParId >= 0)
  413.       {
  414.          var _loc3_ = this.mLemma.GetParagraphById(inSelParId);
  415.          if(_loc3_.mLevel > 1)
  416.          {
  417.             this.mIntervalId = setInterval(this,"ScrollTextTo",200,_loc3_.mTitolo,true);
  418.          }
  419.       }
  420.    }
  421.    function ScrollTextTo(inSeltext, addBR)
  422.    {
  423.       clearInterval(this.mIntervalId);
  424.       this.mc_HtmlRenderer.htmlText = StringUtils.HtmlFunction(inSeltext);
  425.       var _loc3_ = this.mc_HtmlRenderer.text;
  426.       if(addBR)
  427.       {
  428.          _loc3_ += "\r";
  429.       }
  430.       this.mc_TxtTestoLemma.setFocus();
  431.       var _loc4_ = this.mc_TxtTestoLemma.label.text;
  432.       var _loc2_ = _loc4_.indexOf(_loc3_);
  433.       if(_loc2_ >= 0)
  434.       {
  435.          Selection.setSelection(_loc2_,_loc2_);
  436.       }
  437.       else
  438.       {
  439.          Selection.setSelection(0,0);
  440.       }
  441.    }
  442.    function ShowIndex(inChapterNum)
  443.    {
  444.       this.mc_LblSottoTitolo.htmlText = this.mLemma.GetIndiceTitle();
  445.       this.mc_LblSottoTitolo.hscroll = 0;
  446.       this.mc_TxtTestoLemma._visible = false;
  447.       var _loc2_ = this.mc_TreeIndiceLemma.getTreeNodeAt(0);
  448.       if(inChapterNum == 0 && this.mLemma.HaveIntroduction())
  449.       {
  450.          this.mc_TreeIndiceLemma.__set__selectedNode(_loc2_);
  451.       }
  452.       else
  453.       {
  454.          this.mc_TreeIndiceLemma.setIsOpen(_loc2_,true);
  455.          var _loc3_ = inChapterNum;
  456.          if(this.mLemma.HaveIntroduction())
  457.          {
  458.             _loc3_ = inChapterNum - 1;
  459.          }
  460.          var _loc5_ = _loc2_.childNodes[_loc3_];
  461.          this.mc_TreeIndiceLemma.__set__selectedNode(_loc5_);
  462.       }
  463.       this.mc_TreeIndiceLemma._visible = true;
  464.       if(!this.rb_IndiceVoce.selected)
  465.       {
  466.          this.rb_IndiceVoce.selected = true;
  467.       }
  468.       this.ShowNumericStepper(false,0);
  469.    }
  470.    function Hilite(context, contextParm, startPos, endPos)
  471.    {
  472.       var _loc2_ = true;
  473.       if(context == "title")
  474.       {
  475.          Selection.setFocus(this.mc_LblTitolo);
  476.       }
  477.       else if(context == "abstract")
  478.       {
  479.          this.ShowAbstract();
  480.          Selection.setFocus(this.mc_TxtTestoLemma);
  481.       }
  482.       else if(context == "chapterTitle")
  483.       {
  484.          this.ShowChapter(contextParm);
  485.          Selection.setFocus(this.mc_LblSottoTitolo);
  486.       }
  487.       else if(context == "chapterText")
  488.       {
  489.          this.ShowChapter(contextParm);
  490.          Selection.setFocus(this.mc_TxtTestoLemma);
  491.       }
  492.       else
  493.       {
  494.          _loc2_ = false;
  495.       }
  496.       if(_loc2_)
  497.       {
  498.          Selection.setSelection(startPos,endPos);
  499.       }
  500.    }
  501.    function Hide(Void)
  502.    {
  503.       this._visible = false;
  504.    }
  505.    function Show(Void)
  506.    {
  507.       this._visible = true;
  508.       this.dispatchEvent({type:"onXXIWindowMessage",target:this,windowName:"lemma",action:"open"});
  509.    }
  510.    function Back(Void)
  511.    {
  512.       this.Close();
  513.       if(_root.gAppendiceSearch)
  514.       {
  515.          _root.gAppendiceSearch.Back();
  516.       }
  517.    }
  518.    function Close(Void)
  519.    {
  520.       this.Hide();
  521.       this.dispatchEvent({type:"onXXIWindowMessage",target:this,windowName:"lemma",action:"close"});
  522.    }
  523.    function clearUI()
  524.    {
  525.    }
  526.    function Copy(inWhat)
  527.    {
  528.       var _loc7_ = false;
  529.       if(inWhat == "" && this.mLemma.GetChapterLenght() > 1)
  530.       {
  531.          _loc7_ = true;
  532.       }
  533.       else
  534.       {
  535.          var _loc4_ = StringUtils.HtmlToText(this.mLemma.mTitolo) + "\r\r\r";
  536.          if(inWhat == "copyVisible")
  537.          {
  538.             if(this.mCurrentTab == "testoVoce")
  539.             {
  540.                _loc4_ += StringUtils.HtmlToText(this.mLemma.GetChapterTitle(this.mCurrentChapter)) + "\r" + StringUtils.HtmlToText(this.mLemma.GetChapterText(this.mCurrentChapter)) + "\r\r\r";
  541.             }
  542.             else if(this.mCurrentTab == "abstract")
  543.             {
  544.                _loc4_ += "Abstract\r" + StringUtils.HtmlToText(this.mLemma.GetAbstractText()) + "\r\r\r";
  545.             }
  546.             else if(this.mCurrentTab == "indice")
  547.             {
  548.                _loc4_ += "Indice\r\r";
  549.                var _loc3_ = 0;
  550.                while(_loc3_ < this.mLemma.mParagraphList.length)
  551.                {
  552.                   var _loc2_ = this.mLemma.mParagraphList[_loc3_];
  553.                   var _loc5_ = _loc2_.mTitoloSommario.length <= 0 ? _loc2_.mTitolo : _loc2_.mTitoloSommario;
  554.                   _loc4_ += StringUtils.TabToSpace(_loc2_.mLevel) + StringUtils.HtmlToText(StringUtils.HtmlFunction(_loc5_)) + "\r";
  555.                   _loc3_ = _loc3_ + 1;
  556.                }
  557.             }
  558.          }
  559.          else
  560.          {
  561.             if(this.mLemma.HaveAbstract())
  562.             {
  563.                _loc4_ += "Abstract\r" + StringUtils.HtmlToText(this.mLemma.GetAbstractText()) + "\r\r\r";
  564.             }
  565.             var _loc6_ = this.mLemma.GetChapterLenght();
  566.             _loc3_ = 0;
  567.             while(_loc3_ < _loc6_)
  568.             {
  569.                _loc4_ += StringUtils.HtmlToText(this.mLemma.GetChapterTitle(_loc3_)) + "\r" + StringUtils.HtmlToText(this.mLemma.GetChapterText(_loc3_)) + "\r\r\r";
  570.                _loc3_ = _loc3_ + 1;
  571.             }
  572.          }
  573.          System.setClipboard(_loc4_);
  574.       }
  575.       return _loc7_;
  576.    }
  577.    function Print(inWhat)
  578.    {
  579.       var _loc4_ = false;
  580.       if(inWhat == "" && this.mLemma.GetChapterLenght() > 1)
  581.       {
  582.          _loc4_ = true;
  583.       }
  584.       else
  585.       {
  586.          var _loc6_ = inWhat != "printVisible" ? "all" : "visible";
  587.          var _loc3_ = this.GetHtml(_loc6_);
  588.          if(_loc3_.html != "" && _global.gPrint)
  589.          {
  590.             _global.gPrint.PrintHtml(_loc3_.header,_loc3_.html);
  591.          }
  592.       }
  593.       return _loc4_;
  594.    }
  595.    function Save(inWhat)
  596.    {
  597.       var _loc5_ = false;
  598.       if(inWhat == "" && this.mLemma.GetChapterLenght() > 1)
  599.       {
  600.          _loc5_ = true;
  601.       }
  602.       else
  603.       {
  604.          var _loc6_ = inWhat != "saveVisible" ? "all" : "visible";
  605.          var _loc4_ = this.GetHtml(_loc6_);
  606.          if(_loc4_.html != "" && _root.gAppendiceSearch)
  607.          {
  608.             var _loc7_ = _global.gStyleManager.CSStoHTML(_global.gStyleManager.GetCSS());
  609.             _root.gAppendiceSearch.ExportHtmlFile(this.mLemma.mTitolo,_loc7_,_loc4_.header,_loc4_.html);
  610.          }
  611.       }
  612.       return _loc5_;
  613.    }
  614.    function GetHtml(inWhat)
  615.    {
  616.       var _loc7_ = "";
  617.       var _loc4_ = "<span class=\'s_title0\'>" + StringUtils.HtmlFunction(this.mLemma.mTitolo) + "</span><br><br>";
  618.       if(inWhat == "visible")
  619.       {
  620.          _loc7_ = "<span class=\"s_Header\">Estratto dalla voce: " + StringUtils.HtmlFunction(this.mLemma.mTitolo) + " della Settima Appendice</span><br>";
  621.          if(this.mCurrentTab == "testoVoce")
  622.          {
  623.             _loc4_ += this.mLemma.GetChapterTitle(this.mCurrentChapter) + "<br>" + this.mLemma.GetChapterText(this.mCurrentChapter) + "<br><br>";
  624.          }
  625.          else if(this.mCurrentTab == "abstract")
  626.          {
  627.             _loc4_ += "<span class=\"s_title1\">Abstract</span><br>" + this.mLemma.GetAbstractText() + "<br><br>";
  628.          }
  629.          else if(this.mCurrentTab == "indice")
  630.          {
  631.             _loc4_ += "<span class=\"s_title1\">Indice</span><br><br>";
  632.             var _loc3_ = 0;
  633.             while(_loc3_ < this.mLemma.mParagraphList.length)
  634.             {
  635.                var _loc2_ = this.mLemma.mParagraphList[_loc3_];
  636.                var _loc5_ = _loc2_.mTitoloSommario.length <= 0 ? _loc2_.mTitolo : _loc2_.mTitoloSommario;
  637.                _loc4_ += StringUtils.TabToSpace(_loc2_.mLevel) + StringUtils.HtmlFunction(_loc5_) + "<br>";
  638.                _loc3_ = _loc3_ + 1;
  639.             }
  640.          }
  641.       }
  642.       else
  643.       {
  644.          _loc7_ = "<span class=\"s_Header\">Voce: " + StringUtils.HtmlFunction(this.mLemma.mTitolo) + " della Settima Appendice</span><br>";
  645.          if(this.mLemma.HaveAbstract())
  646.          {
  647.             _loc4_ += "<span class=\"s_title1\">Abstract</span><br>" + this.mLemma.GetAbstractText() + "<br><br>";
  648.          }
  649.          var _loc6_ = this.mLemma.GetChapterLenght();
  650.          _loc3_ = 0;
  651.          while(_loc3_ < _loc6_)
  652.          {
  653.             _loc4_ += this.mLemma.GetChapterTitle(_loc3_) + "<br>" + this.mLemma.GetChapterText(_loc3_) + "<br><br>";
  654.             _loc3_ = _loc3_ + 1;
  655.          }
  656.       }
  657.       return {html:_loc4_,header:_loc7_};
  658.    }
  659.    function onFontSizeChanged()
  660.    {
  661.       if(this._visible && this.mc_TxtTestoLemma._visible)
  662.       {
  663.          this.mc_TxtTestoLemma.__set__text(this.mc_TxtTestoLemma.text);
  664.       }
  665.    }
  666. }
  667.